import request from '@/utils/request'
const prefix = "/user"

export function login(params) {
  return request({
    method: "POST",
    url: prefix + "/login",
    data: params
  })
}

export function logout() {
  return request({
    method: "POST",
    url: prefix + "/logout"
  })
}

export function register(params) {
  return request({
    method: "POST",
    url: prefix + "/register",
    data: params
  })
}

export function update(params) {
  return request({
    method: "POST",
    url: prefix + "/update",
    data: params
  })
}

// 修改密码接口：无需接收config，request.js自动处理token
export function updatePwd(params) {
  return request({
    method: "POST",
    url: prefix + "/updatePwd",
    data: params
  })
}

// export function getMyDetail() {
//   return request({
//     method: "GET",
//     url: prefix + "/detail"
//   })
// }